<?php 
   include "counter.php";
   requirelogin();
   $u = User::create(); // object for currently logged-in user

   if (!(int)$u->userid) {
       header("Location:http://counter.li.org/person/login.php");
   }

   pagestart ();
# Fetch parameters
  $url = $counter->get_input("url", "", "get");
?>
<html>
<?php pagehead("Change Password") ?>
<body>
<?php pagetop("Change Password") ?>
<h2>Change your password</h2>
<form method="post" action="<?php print $secure_counter_site ?>/cgi-bin/runscript/change_password.cgi">
<table>
<tr><td>Current Password<td><input type="password" name="current_password">
<tr><td>Password<td><input type="password" name="new_password1">
<tr><td>Again   <td><input type="password" name="new_password2">
<tr><td><td><input type="submit" name="enter" value="Enter">
</table>
<input type="hidden" name="url"
<?php 
 $http_host = getenv("HTTP_HOST");
 if ($url != "") {
    echo "value=\"$url\"";
 } else if (preg_match("!^http://$http_host!", getenv("HTTP_REFERER"))) {
      echo "value=\"", getenv("HTTP_REFERER"), "\"";
 } else {
      echo "value=\"/person/\"";
}
?>
>

</form>
<p>
Both passwords filled in above must be equal to each other. If not, you will get an error 
and your password will not be changed.
</p>
Please report problems to <?php print emailCloaking("help@counter.li.org", 0) ?>
<h2>Site security</h2>
<a href="http://www.cacert.org/" target="_blank"><img src="/gifs/cacert-grey2.png" alt="www.cacert.org" style="border-width: 0px;" /></a><em> This site is secured with a certificate from CAcert. The first time when you visit a part of our site that is secured with a certificate from CAcert, you will get a popup from you browser telling you that you do not trust this site. To get rid of that popup in future you can install the certificate from the Linux Counter site.<br>
Alas, not many applications have installed by default the CAcert Class 1 and Class 3 root certificates that the Linux Counter certificate is based on. Thus, when installing the Linux Counter certificate your browser will probably complain about the fact that their is not enough information to verify the certificate. This means that your browser is missing the CAcert Class 1 and Class 3 root certificates. You can get these certificates from <a href="http://www.cacert.org/index.php?id=3">CAcert</a>. After installing these certificates the validation of the Linux Counter certificate will be correct.</em>

<?php pagebottom("yes") ?>
</body>
</html>
